package HLLibClasses;

import HLCode.HLClassManager;
import HLCode.HLLibClass;
import HLCode.HLObject;
import HLLib.base.HLByteList;
import HLLib.base.HLGraphics;
import HLLib.base.HLString;
import HLLib.userControl.HLChallenge;

public class HLClassChallenge extends HLLibClass {
    public HLClassChallenge(HLClassManager owner) {
        super(owner);
    }

    public HLObject NewObject() {
        return new HLChallenge();
    }

    public void Execute(HLObject self, int index, HLObject args, HLObject resultOwnerObject, int resultIndex) {
        switch (index) {
        case 0: {
            ((HLChallenge) self).Logic();
            break;
        }
        case 1: {
            ((HLChallenge) self).Render((HLGraphics)args.GetObject(0));
            break;
        }
        case 2: {
            if (resultOwnerObject == null) {
                ((HLChallenge) self).GetChallengeId();
            } else {
                resultOwnerObject.SetInt(resultIndex, ((HLChallenge) self).GetChallengeId());
            }
            break;
        }
        case 3: {
            if (resultOwnerObject == null) {
                ((HLChallenge) self).GetChallengeSeed();
            } else {
                resultOwnerObject.SetInt(resultIndex, ((HLChallenge) self).GetChallengeSeed());
            }
            break;
        }
        case 4: {
            if (resultOwnerObject == null) {
                ((HLChallenge) self).GetView();
            } else {
                resultOwnerObject.SetObject(resultIndex, ((HLChallenge) self).GetView());
            }
            break;
        }
        case 5: {
            ((HLChallenge) self).ChangePage(args.GetInt(0));
            break;
        }
        }
    }

    public void StaticExecute(int index, HLObject args, HLObject resultOwnerObject, int resultIndex) {
        switch (index) {
        case 0: {
            HLChallenge.Create();
            break;
        }
        case 1: {
            HLChallenge.FinishChall(args.GetInt(0), args.GetInt(1), args.GetInt(2), (HLByteList)args.GetObject(0));
            break;
        }
        case 2: {
            HLChallenge.Challenge(args.GetInt(0));
            break;
        }
        case 3: {
            HLChallenge.FinishChallenge(args.GetInt(0), args.GetInt(1), (HLByteList)args.GetObject(0));
            break;
        }
        case 4: {
            HLChallenge.GetAllowChallenge();
            break;
        }
        case 5: {
            HLChallenge.GetMyChallenge(args.GetInt(0));
            break;
        }
        case 6: {
            HLChallenge.GetMyJoinedChallenge(args.GetInt(0));
            break;
        }
        case 7: {
            HLChallenge.ViewOwnerVideo(args.GetInt(0));
            break;
        }
        case 8: {
            HLChallenge.ViewChallengerrVideo(args.GetInt(0));
            break;
        }
        case 9: {
            HLChallenge.ReportSomebody(args.GetInt(0), (HLString)args.GetObject(0), args.GetInt(1));
            break;
        }
        }
    }
}
